package pl.com.like.sequoia.model.admin;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import pl.com.like.sequoia.model.Pojo;
import pl.com.like.sequoia.model.security.User;

@Entity
@Table(name = "uploaded_file")
@SequenceGenerator(name = "uploaded_file_seq", sequenceName = "uploaded_files_seq", allocationSize = 1)
public class UploadedFile extends Pojo<Long> {

	@Transient
	private static final long serialVersionUID = -8844877458153859530L;

	@Id
	@Column(name = "id")
	@GeneratedValue(generator = "uploaded_file_seq", strategy = GenerationType.SEQUENCE)
	private Long id;
	@Column(name = "upload_date", nullable = false)
	private Date uploadDate;
	@Column(name = "scan_date")
	private Date scanningDate;
	@Column(name = "scanned", nullable = false)
	private Boolean scanned;
	@Column(name = "scan_result")
	private Boolean scanResult;
	@JoinColumn(name = "owner_id")
	@ManyToOne
	private User owner;
	@Column(length = 2000, nullable = false, name = "path")
	private String path;
	@Column(length = 3000, name = "scan_info")
	private String scanInfo;

	@Override
	public Long getId() {
		return id;
	}

	public User getOwner() {
		return owner;
	}

	public String getPath() {
		return path;
	}

	public String getScanInfo() {
		return scanInfo;
	}

	public Boolean getScanned() {
		return scanned;
	}

	public Date getScanningDate() {
		return scanningDate;
	}

	public Boolean getScanResult() {
		return scanResult;
	}

	public Date getUploadDate() {
		return uploadDate;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public void setScanInfo(String scanInfo) {
		this.scanInfo = scanInfo;
	}

	public void setScanned(Boolean scanned) {
		this.scanned = scanned;
	}

	public void setScanningDate(Date scanningDate) {
		this.scanningDate = scanningDate;
	}

	public void setScanResult(Boolean scanResult) {
		this.scanResult = scanResult;
	}

	public void setUploadDate(Date uploadDate) {
		this.uploadDate = uploadDate;
	}

}
